Package com.rnett.plugin.stdlib

The com.rnett.plugin.stdlib package provides builders for common standard library functions, using the Naming and IR Utilities features (and providing good examples of how to use them). Collections, toString and hashCode, typeOf, scope functions, numbers, and common exceptions are included. All builder methods are tested. Note that unlike for Naming, extension functions are members of their extension receiver, i.e. Map.getValue. In some cases, builders will resolve their functions based on the types of arguments, such as for number operators or nullable toString and hashCode. The receiver arguments are type checked (in IR) in most cases, the other arguments aren't.

Note that using a lot of these functions is a bad idea. If you find yourself generating a lot of code using these methods, you should probably create a utility function and call it from IR instead. The number of builders is there to provide breadth, not depth.

Types

AnyBuilders
Link copied to clipboard
class AnyBuilders(builder: IrBuilderWithScope, context: IrPluginContext) : MethodBuilder
ArrayBuilders
Link copied to clipboard
class ArrayBuilders(builder: IrBuilderWithScope, context: IrPluginContext) : TypedMethodBuilder
CollectionBuilders
Link copied to clipboard
open class CollectionBuilders(builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : IterableBuilders
CollectionsBuilders
Link copied to clipboard
class CollectionsBuilders(stdlib: StdlibBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : MethodBuilder
ExceptionBuilders
Link copied to clipboard
open class ExceptionBuilders(klass: ExceptionClass, builder: IrBuilderWithScope, context: IrPluginContext) : MethodBuilder
ExceptionBuildersWithCause
Link copied to clipboard
class ExceptionBuildersWithCause(klass: ExceptionClassWithCause, builder: IrBuilderWithScope, context: IrPluginContext) : ExceptionBuilders
ExceptionClass
Link copied to clipboard
interface ExceptionClass
ExceptionClassWithCause
Link copied to clipboard
interface ExceptionClassWithCause : ExceptionClass
IterableBuilders
Link copied to clipboard
open class IterableBuilders(builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : TypedMethodBuilder
JavaLang
Link copied to clipboard
object JavaLang : RootPackage
JavaUtil
Link copied to clipboard
object JavaUtil : RootPackage
Kotlin
Link copied to clipboard
object Kotlin : RootPackage

A collection of References from Kotlin's standard library. Accessible in IR from com.rnett.plugin.ir.HasContext.stdlib

ListBuilders
Link copied to clipboard
open class ListBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : CollectionBuilders
MapBuilders
Link copied to clipboard
open class MapBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : TypedMethodBuilder
MathableBuilders
Link copied to clipboard
class MathableBuilders(mathable: Kotlin.Mathable, builder: IrBuilderWithScope, context: IrPluginContext) : NumberBuilders
MethodBuilder
Link copied to clipboard
abstract class MethodBuilder(builder: IrBuilderWithScope, context: IrPluginContext) : HasContext
MutableListBuilders
Link copied to clipboard
open class MutableListBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : ListBuilders
MutableMapBuilders
Link copied to clipboard
open class MutableMapBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : MapBuilders
MutableSetBuilders
Link copied to clipboard
open class MutableSetBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext) : SetBuilders
NumberBuilders
Link copied to clipboard
open class NumberBuilders(builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : TypedMethodBuilder
SetBuilders
Link copied to clipboard
open class SetBuilders(collections: CollectionsBuilders, builder: IrBuilderWithScope, context: IrPluginContext, type: ClassRef) : CollectionBuilders
StdlibBuilders
Link copied to clipboard
class StdlibBuilders(builder: IrBuilderWithScope, context: IrPluginContext) : MethodBuilder

The standard library builders, accessible from from com.rnett.plugin.ir.HasContext.stdlib

TypedMethodBuilder
Link copied to clipboard
abstract class TypedMethodBuilder(typeCheck: (IrType) -> Boolean, builder: IrBuilderWithScope, context: IrPluginContext, message: (IrExpression) -> String) : MethodBuilder